﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;


public class ColorAssets : ScriptableObject
{
    public ColorAssets assets
    {
        get
        {
            return _sColorAsset;
        }
    }
    static ColorAssets _sColorAsset;


    [System.Serializable]
    public class ColorItem
    {
        public string name;
        public string annotation;
        public Color changeItem;
    }
    public List<ColorItem> Items;

    [System.NonSerialized]
    private Dictionary<string, ColorItem> ColorDict = new Dictionary<string, ColorItem>();
    public ColorItem this[string index]
    {
        get
        {
            if(ColorDict.ContainsKey(index) == false)
            {
                foreach (var item in Items)
                {
                    if (item.name.Equals(index))
                    {
                        ColorDict[index] = item;
                    }
                }
            }

            return ColorDict[index];
        }
    }
}
